import { userInfor } from './types/userInfor'
import axios from "@/utils/http"
import { tokenStore } from '@/store/modules/user';


export const modifyWhiteList = (params: userInfor) => {
    return axios({
        url: "/api/modify_whitelist",
        method: "post",
        params,
        
    })
}
export const showWhiteList = (params:Object) => {
    return axios({
        url: "/api/show_whitelist",
        method: "get",
        params,
        
    })
}
export const showBlackList = (params:Object) => {
    return axios({
        url: "/api/show_blacklist",
        method: "get",
        params,
        
    })
}
export const addWhiteList = (params:userInfor) => {
    return axios({
        url: "/api/add_whitelist",
        method: "post",
        params,
       
    })
}
export const addBlackList = (params:Object) => {
    return axios({
        url: "/api/add_blacklist",
        method: "post",
        params,
        
    })
}
export const deleteWhiteList = (params:Object) => {
    return axios({
        url: "/api/delete_whitelist",
        method: "post",
        params,
        
    })
}
export const deleteBlackList = (params:Object) => {
    return axios({
        url: "/api/delete_blacklist",
        method: "post",
        params,
        
    })
}

//老人信息
export const showOldList = (params:Object) => {
    return axios({
        url: "/api/show_elder",
        method: "get",
        params,
        
    })
}

export const addElder = (params:Object) => {
    return axios({
        url: "/api/add_elder",
        method: "post",
        params,
    })
}

export const deleteElder = (params:Object) => {
    return axios({
        url: "/api/delete_elder",
        method: "post",
        params,
    })
}

export const modifyElder = (params:Object) => {
    return axios({
        url: "/api/modify_elder",
        method: "post",
        params,
    })
}

export const showOldHealth = ( id: string | number ) => {
    return axios({
        url: "/api/health_data/"+id,
        method: 'get',

    });
}

// 护工
export const showCare = (params:Object) => {
    return axios({
        url: "/api/show_caregiver",
        method: "get",
        params,

    })
}

export const addCare = (params:Object) => {
    return axios({
        url: "/api/add_caregiver",
        method: "post",
        params,
    })
}

export const deleteCare = (params:Object) => {
    return axios({
        url: "/api/delete_caregiver",
        method: "post",
        params,
    })
}

export const modifyCare = (params:Object) => {
    return axios({
        url: "/api/modify_caregiver",
        method: "post",
        params,
    })
}
